home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 009 / batch30.fix < prev    next >
Text File  |  1985-04-06  |  1KB  |  51 lines

  1. Batch processing in DOS 3.00 will truncate lines
  2. that use %name% environment variables.
  3. (Of course there's no way to get IBM to admit to a problem
  4.  in a feature they don't document.)
  5.  
  6. For example (with set NAME=VALUE1)
  7.  
  8. IF %NAME% == VALUE1 ECHO I GOT WHAT I WANT
  9.  
  10. becomes
  11.  
  12. IF VALUE1
  13. and causes a syntax error.
  14.  
  15. IF VALUE1 == %NAME% ECHO I GOT IT
  16.  
  17. becomes
  18.  
  19. IF VALUE1 == VALUE1
  20. and you still have a problem.
  21.  
  22. If %NAME% is the last word in a BAT line the problem
  23. goes undetected.
  24.  
  25. GOTO %NAME%
  26.  
  27. works fine.
  28.  
  29. The following patch will make all well again.
  30.  
  31.  
  32. DEBUG COMMAND.COM
  33. u172b        ;to verify the following
  34. xxxx:172B E8CD0E  CALL       25FB
  35. xxxx:172E 06      PUSH       ES
  36.  
  37. a172b
  38. jmp 453a    ;jump to patch - overlays a message "Access denied"
  39.  
  40. a453a
  41. push cx
  42. call 25fb
  43. pop  cx
  44. jmp  172e
  45.  
  46. e47b0 61    ;makes version 3.00a in VER command so you know you have patch
  47.         ;you can make this any character that pleases you.
  48.  
  49. w        ;should write 561a bytes
  50. q
  51.